﻿<DemoPageSectionComponent Id="Editors-Memo-OnInputBinding" ShowSizeMode="true">
    <ChildContentWithParameters Context="Params">
        <label for="memoInputBinding" class="demo-text cw-480 mb-1">
            Description
        </label>
        <DxMemo @bind-Text="TextValue"
                SizeMode="Params.SizeMode"
                BindValueMode="@BindValueMode"
                NullText="Type text..."
                InputDelay="@InputDelay"
                CssClass="cw-480"
                Rows="5"
                InputId="memoInputBinding" />
        <p class="demo-text cw-480 mt-3">
            The entered text is: <b>@TextValue</b>
        </p>
    </ChildContentWithParameters>

    <OptionsContent>
        <OptionComboBox CssClass="ow-150"
                        Data="Enum.GetValues<BindValueMode>()"
                        @bind-Value="BindValueMode"
                        Label="Bind Value Mode:"/>
        <OptionSpinEdit CssClass="ow-150"
                        MinValue="100"
                        MaxValue="1000"
                        Increment="100"
                        Enabled="@BindDelayEnabled"
                        Label="Input Delay:"
                        @bind-Value="InputDelay" />
    </OptionsContent>

    @code {
        string TextValue { get; set; } = null;
        int? InputDelay { get; set; } = 500;
        BindValueMode BindValueMode { get; set; } = BindValueMode.OnInput;
        bool BindDelayEnabled { get { return BindValueMode == BindValueMode.OnDelayedInput; } }
    }
</DemoPageSectionComponent>
